// src/components/Upload/types.ts

// 上传配置类型
export interface UploadConfig {
  baseURL?: string;
  endpoint: string;
  maxParallel?: number;
  headers?: Record<string, string>;
  allowedTypes?: string[];
  maxSizeMB?: number;
  dimensions?: {
    width: number;
    height: number;
  };
   onProgress?: (progress: number) => void; // 添加这行
}

// 上传任务类型
export interface UploadTask {
  file: File;
  config: UploadConfig;
  resolve: (value: unknown) => void;
  reject: (reason?: any) => void;
}

// 验证结果类型
export interface ValidationResult {
  valid: boolean;
  message?: string;
}

// 上传进度回调
export type ProgressCallback = (progress: number) => void;